package com.demo.client.model.dict;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.demo.core.annotation.TableFieldDefaultValue;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @author Tan-Bowen
 * @description TODO
 * @className SysDict
 * @date 2021-08-05 11:25
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("字典信息")
@TableName(value = "sys_dict")
public class SysDict implements Serializable {

    @ApiModelProperty("主键id")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty("父级id")
    @TableFieldDefaultValue(value = "0")
    private Long parentId;

    @ApiModelProperty("名称")
    @TableFieldDefaultValue(value = "''")
    private String name;

    @ApiModelProperty("1启用")
    @TableFieldDefaultValue(value = "1")
    private Integer status;

    @ApiModelProperty("序号")
    @TableFieldDefaultValue(value = "0")
    private Integer sort;

    @ApiModelProperty("备注")
    @TableFieldDefaultValue(value = "''")
    private String remark;

    @ApiModelProperty("字典code")
    @TableFieldDefaultValue(value = "''")
    private String code;

    @ApiModelProperty("上级code")
    @TableFieldDefaultValue(value = "''")
    private String parentCode;

    @ApiModelProperty("创建时间")
    @TableFieldDefaultValue(value = "CURRENT_TIMESTAMP")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty("创建人")
    private Long createUser;

    @ApiModelProperty("修改时间")
    @TableFieldDefaultValue(value = "CURRENT_TIMESTAMP")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @ApiModelProperty("修改人")
    private Long updateUser;

    @ApiModelProperty("是否删除")
    @TableFieldDefaultValue(value = "0")
    private Integer delFlag;

}
